<template>
  <RouterView />
  <van-tabbar v-model="active">
    <van-tabbar-item icon="home-o" @click="homePageFn">首页</van-tabbar-item>
    <van-tabbar-item icon="envelop-o" @click="aboutFn">关于</van-tabbar-item>
    <van-tabbar-item icon="user-o" @click="mineFn">我的</van-tabbar-item>
  </van-tabbar>
</template>
<script setup lang="ts">
import { RouterLink, RouterView, useRouter } from 'vue-router'
import { ref } from 'vue'
const router = useRouter()
const active = ref(0)
const homePageFn = () => {
  router.push({ path: '/' })
  // router.push({ path: '/', query: { type: 'addaa' }})
}
const aboutFn = () => {
  // params 传递参数需要路由版本支持，最新版的4.1.6的不支持
  // router.push({ name: 'about', params: { id: '666' }})
  router.push({ path: '/about', query: { type: 'addaa' } })
}
const mineFn = () => {
  router.push({ path: '/mine', query: { type: 'addaa' } })
}
</script>
<style scoped></style>
